package org.fuxia.im.core.socket;

import java.io.File;
import java.io.IOException;

public class FileTransferDemo
{
	public static void testFileTranferServer() throws IOException
	{
		File file = new File("test.pdf");
		if (!file.exists())
		{
			file.createNewFile();
		}
		else
		{
			file.delete();
		}
		System.out.println(file.getAbsolutePath());
		FileTransferScoketServer server = null;
		try
		{
			server = FileTransferScoketServer.newInstance();
		}
		catch (Exception e)
		{
			e.printStackTrace();
		}
		server.setFile(file);
		new Thread(server).start();
	}

	public static void main(String[] args)
	{
		try
		{
			testFileTranferServer();
		}
		catch (IOException e)
		{
			e.printStackTrace();
		}
	}
}
